package com.xtaller.lazy.config.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @version V1.0
 * @author: Taller
 * @date: 2019-04-03
 * @Description: 拦截配置
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Resource
    public InterceptorPermission permission;
    @Resource
    public InterceptorBase base;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(base).addPathPatterns("/v*/**");
        registry.addInterceptor(permission).addPathPatterns("/v*/**");
    }
}
